home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / GNUstep / Makefiles / GNUstep.sh < prev    next >
Encoding:
Text File  |  2010-05-31  |  22.0 KB  |  671 lines

  1. #   This file must be sourced inside (ba)sh using: .
  2. #
  3. #   GNUstep.sh.  Generated from GNUstep.sh.in by configure.
  4. #
  5. #   Shell initialization for the GNUstep environment.
  6. #
  7. #   Copyright (C) 1997-2008 Free Software Foundation, Inc.
  8. #
  9. #   Author:  Scott Christley <scottc@net-community.com>
  10. #   Author:  Adam Fedor <fedor@gnu.org>
  11. #   Author:  Richard Frith-Macdonald <rfm@gnu.org>
  12. #   Author:  Nicola Pero <nicola.pero@meta-innovation.com>
  13. #
  14. #   This file is part of the GNUstep Makefile Package.
  15. #
  16. #   This library is free software; you can redistribute it and/or
  17. #   modify it under the terms of the GNU General Public License
  18. #   as published by the Free Software Foundation; either version 3
  19. #   of the License, or (at your option) any later version.
  20. #   
  21. #   You should have received a copy of the GNU General Public
  22. #   License along with this library; see the file COPYING.
  23. #   If not, write to the Free Software Foundation,
  24. #   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  25. #
  26.  
  27. # Warning - this shell script is delicate, because it is sourced by
  28. # using . rather than simply executed.  It is sourced because that is
  29. # the only way to change the shell variables in the calling
  30. # environment.
  31. #
  32. # Sourcing makes the shell script more delicate for the following reasons:
  33. #
  34. #  * temporary variables are automatically set in the calling
  35. #  environment!  WORKAROUND: we need to unset all them after using
  36. #  them to avoid polluting the calling environment;
  37. #
  38. #  * not only the exit value of the script, but the exit value of each
  39. #  command we execute, might be interpreted by the calling
  40. #  environment.  Typically, the calling environment might be using the
  41. #  shell errexit option ('set -e') in bash parlance, which causes the
  42. #  shell to exit if any command returns an error value.  If this were
  43. #  a normal script, this option would mean that the shell would exit
  44. #  if the return value of the whole script were an error value; but
  45. #  because we are sourced, it is as all the commands in this script
  46. #  were executed directly in the calling environment, so *all* values
  47. #  returned by *all* commands must be non-error.  [this all typically
  48. #  happens in rpm builds, where scripts are run with the errexit
  49. #  option so that errors in scripts abort the build, and now if a
  50. #  script sources GNUstep.sh, then we are exactly in this situation -
  51. #  if any command inside GNUstep.sh returns an error value (even if
  52. #  GNUstep.sh as a whole would be happy and return succes), the whole
  53. #  rpm build process aborts!]. WORKAROUND: we must make sure all
  54. #  commands return success - last resorts hacks like 'command || :'
  55. #  which always returns success whatever command returns.
  56. #
  57.  
  58. # If we're running in zsh (auch!) make sure we're using -y
  59. # (SH_WORD_SPLIT) else our path manipulations won't work.
  60. if [ -n "$ZSH_VERSION" ]; then
  61.  
  62.   # If -y is not already set, set it and remember that we
  63.   # need to set it back to what it was at the end.
  64.   if ( setopt | grep shwordsplit > /dev/null ); then :; else
  65.     set -y
  66.     GS_ZSH_NEED_TO_RESTORE_SET=yes
  67.   fi
  68.  
  69. fi
  70.  
  71. # When this is set to 'yes', strict gnustep-make v2 compatibility mode
  72. # is turned on.
  73. GNUSTEP_MAKE_STRICT_V2_MODE=no
  74.  
  75. #
  76. # Read our configuration files
  77. #
  78.  
  79. # Determine the location of the system configuration file
  80. if [ -z "$GNUSTEP_CONFIG_FILE" ]; then
  81.   GNUSTEP_CONFIG_FILE=/etc/GNUstep/GNUstep.conf
  82. else
  83.   # Remember that the variable was already set in the environment, and
  84.   # preserve it at the end of the script.  Otherwise we'll unset it to
  85.   # avoid polluting the environment with our own internal variables.
  86.   GNUSTEP_KEEP_CONFIG_FILE=yes
  87. fi
  88.  
  89. # Determine the location of the user configuration file
  90. if [ -z "$GNUSTEP_USER_CONFIG_FILE" ]; then
  91.   GNUSTEP_USER_CONFIG_FILE=.GNUstep.conf
  92. else
  93.   GNUSTEP_KEEP_USER_CONFIG_FILE=yes
  94. fi
  95.  
  96. # Read the system configuration file
  97. if [ -f "$GNUSTEP_CONFIG_FILE" ]; then
  98.   . "$GNUSTEP_CONFIG_FILE"
  99. fi
  100.  
  101. # FIXME: determining GNUSTEP_HOME
  102. GNUSTEP_HOME=~
  103.  
  104. # Read the user configuration file ... unless it is disabled (ie, set
  105. # to an empty string)
  106. if [ -n "$GNUSTEP_USER_CONFIG_FILE" ]; then
  107.   case "$GNUSTEP_USER_CONFIG_FILE" in 
  108.     /*) # An absolute path
  109.         if [ -f "$GNUSTEP_USER_CONFIG_FILE" ]; then
  110.           . "$GNUSTEP_USER_CONFIG_FILE"
  111.         fi;;
  112.      *) # Something else
  113.         if [ -f "$GNUSTEP_HOME/$GNUSTEP_USER_CONFIG_FILE" ]; then
  114.           . "$GNUSTEP_HOME/$GNUSTEP_USER_CONFIG_FILE"
  115.         fi;;
  116.   esac
  117. fi
  118.  
  119. # Now, set any essential variable (that is not already set) to the
  120. # built-in values.
  121.  
  122. if [ "$GNUSTEP_MAKE_STRICT_V2_MODE" = "yes" ]; then
  123.   # In strict v2 mode, clean these obsolete variables in case the
  124.   # config file contains them.  They shouldn't exist so unsetting
  125.   # them can't harm.
  126.   unset GNUSTEP_SYSTEM_ROOT
  127.   unset GNUSTEP_LOCAL_ROOT
  128.   unset GNUSTEP_NETWORK_ROOT
  129. else
  130.   # This is deprecated and will be removed
  131.   if [ -z "$GNUSTEP_SYSTEM_ROOT" ]; then
  132.     GNUSTEP_SYSTEM_ROOT=/usr/System
  133.   fi
  134.  
  135.   # This is deprecated and will be removed
  136.   if [ -z "$GNUSTEP_LOCAL_ROOT" ]; then
  137.     GNUSTEP_LOCAL_ROOT=/usr/Local
  138.   fi
  139.  
  140.   # This is deprecated and will be removed
  141.   if [ -z "$GNUSTEP_NETWORK_ROOT" ]; then
  142.     GNUSTEP_NETWORK_ROOT=/usr/Network
  143.   fi
  144.  
  145.   export GNUSTEP_SYSTEM_ROOT GNUSTEP_LOCAL_ROOT GNUSTEP_NETWORK_ROOT
  146. fi
  147.  
  148. # GNUSTEP_FLATTENED is obsolete, please use GNUSTEP_IS_FLATTENED
  149. # instead
  150. if [ "$GNUSTEP_MAKE_STRICT_V2_MODE" = "yes" ]; then
  151.   unset GNUSTEP_FLATTENED
  152. else
  153.   GNUSTEP_FLATTENED=yes
  154.   export GNUSTEP_FLATTENED
  155. fi
  156. GNUSTEP_IS_FLATTENED=yes
  157. if [ -z "$LIBRARY_COMBO" ]; then
  158.   LIBRARY_COMBO=gnu-gnu-gnu
  159. fi
  160. if [ ! "$GNUSTEP_MAKE_STRICT_V2_MODE" = "yes" ]; then
  161.   # Having these variables in the environment is deprecated and will
  162.   # be removed.  But for now, if we are not in strict gnustep-make v2
  163.   # mode, then we always export these variables for
  164.   # backwards-compatibility.
  165.   export GNUSTEP_IS_FLATTENED LIBRARY_COMBO
  166.  
  167.   # Else they are only exported if GNUSTEP_SH_EXPORT_ALL_VARIABLES
  168.   # is defined - at the end of the script.
  169. fi
  170.  
  171. if [ -z "$GNUSTEP_MAKEFILES" ]; then
  172.   GNUSTEP_MAKEFILES=/usr/share/GNUstep/Makefiles
  173. fi
  174. export GNUSTEP_MAKEFILES
  175.  
  176.  
  177. if [ "$GNUSTEP_MAKE_STRICT_V2_MODE" = "yes" ]; then
  178.   # Make sure this is never set in gnustep-make v2 strict mode; it
  179.   # might have been set in the config file.
  180.   unset GNUSTEP_USER_DIR
  181.   unset GNUSTEP_USER_ROOT
  182. else
  183.   # GNUSTEP_USER_DIR is deprecated and will be removed
  184.   if [ -z "$GNUSTEP_USER_DIR" ]; then
  185.     GNUSTEP_USER_DIR=GNUstep
  186.   fi
  187.  
  188.   #
  189.   # Set GNUSTEP_USER_ROOT which is the variable used in practice.
  190.   # GNUSTEP_USER_ROOT is deprecated and will be removed
  191.   #
  192.   case "$GNUSTEP_USER_DIR" in 
  193.     /*) # An absolute path
  194.         GNUSTEP_USER_ROOT="$GNUSTEP_USER_DIR";;
  195.      *) # Something else
  196.         GNUSTEP_USER_ROOT="$GNUSTEP_HOME/$GNUSTEP_USER_DIR";;
  197.   esac
  198.  
  199.   # This variable was used to set up GNUSTEP_USER_ROOT which is the one
  200.   # that is actually exported; we can now drop it from the environment.
  201.   unset GNUSTEP_USER_DIR
  202.  
  203.   # This is deprecated and will be removed
  204.   export GNUSTEP_USER_ROOT
  205. fi
  206.  
  207. # If multi-platform support is disabled, just use the hardcoded cpu,
  208. # vendor and os determined when gnustep-make was configured.  The
  209. # reason using the hardcoded ones might be better is that config.guess
  210. # and similar scripts might even require compiling test files to
  211. # determine the platform - but then you can't source GNUstep.sh
  212. # without having gcc, binutils, libc6-dev installed.  Which can be a
  213. # problem for end-users who are not developers and have no development
  214. # tools installed.  To prevent this problem, unless we were configured
  215. # to determine the platform at run time, by default we use the
  216. # hardcoded values of GNUSTEP_HOST*.
  217. if [ -z "" ]; then
  218.   GNUSTEP_HOST=i486-pc-linux-gnu
  219.   GNUSTEP_HOST_CPU=ix86
  220.   GNUSTEP_HOST_VENDOR=pc
  221.   GNUSTEP_HOST_OS=linux-gnu
  222. fi
  223.  
  224. #
  225. # Determine the host information
  226. #
  227. if [ -z "$GNUSTEP_HOST" ]; then
  228.   # Not all shells (e.g. /bin/sh on FreeBSD < 4.0 or ash) have pushd/popd
  229.   tmpdir=`pwd`; cd /tmp
  230.   GNUSTEP_HOST=`$GNUSTEP_MAKEFILES/config.guess`
  231.   GNUSTEP_HOST=`$GNUSTEP_MAKEFILES/config.sub $GNUSTEP_HOST`
  232.   cd "$tmpdir"
  233.   unset tmpdir
  234. fi
  235.  
  236. if [ -z "$GNUSTEP_HOST_CPU" ]; then
  237.   GNUSTEP_HOST_CPU=`$GNUSTEP_MAKEFILES/cpu.sh $GNUSTEP_HOST`
  238.   GNUSTEP_HOST_CPU=`$GNUSTEP_MAKEFILES/clean_cpu.sh $GNUSTEP_HOST_CPU`
  239. fi
  240.  
  241. if [ -z "$GNUSTEP_HOST_VENDOR" ]; then
  242.   GNUSTEP_HOST_VENDOR=`$GNUSTEP_MAKEFILES/vendor.sh $GNUSTEP_HOST`
  243.   GNUSTEP_HOST_VENDOR=`$GNUSTEP_MAKEFILES/clean_vendor.sh $GNUSTEP_HOST_VENDOR`
  244. fi
  245.  
  246. if [ -z "$GNUSTEP_HOST_OS" ]; then 
  247.   GNUSTEP_HOST_OS=`$GNUSTEP_MAKEFILES/os.sh $GNUSTEP_HOST`
  248.   GNUSTEP_HOST_OS=`$GNUSTEP_MAKEFILES/clean_os.sh $GNUSTEP_HOST_OS`
  249. fi
  250.  
  251. if [ ! "$GNUSTEP_MAKE_STRICT_V2_MODE" = "yes" ]; then
  252.   # These variables are deprecated for usage in shell scripts; you
  253.   # need to use gnustep-config to get them in a shell script.
  254.   export GNUSTEP_HOST GNUSTEP_HOST_CPU GNUSTEP_HOST_VENDOR GNUSTEP_HOST_OS
  255.  
  256.   # Even in strict gnustep-make v2 mode, we export them at the end
  257.   # if explicitly requested to export all variables.
  258. fi
  259.  
  260. # Now load in all the remaining paths
  261. . $GNUSTEP_MAKEFILES/filesystem.sh
  262.  
  263. # No longer needed
  264. unset GNUSTEP_HOME
  265.  
  266. # Determine if the paths look like Windows paths that need fixing
  267. fixup_paths=no
  268. # Here we want to use `...` but the only portable way to use it when
  269. # there are "..." inside the expression (ie, it's actually
  270. # `..."..."...`) seems to be to use it in variable assignments.  So we
  271. # use a temporary variable and assign the result of `...` to it
  272. path_check=`echo "$GNUSTEP_MAKEFILES" | sed 's|^[a-zA-Z]:/.*$||'`
  273. if [ -z "$path_check" ]; then
  274.   fixup_paths=yes
  275. fi
  276. unset path_check
  277.  
  278. if [ "$GNUSTEP_MAKE_STRICT_V2_MODE" = "yes" ]; then
  279.   unset GNUSTEP_PATHLIST
  280. else
  281.   # GNUSTEP_PATHLIST is deprecated and will be removed.
  282.   #
  283.   # GNUSTEP_PATHLIST is like an abstract path-like shell variable, which
  284.   # can be used to search the gnustep directories.
  285.   #
  286.   if [ -z "$GNUSTEP_PATHLIST" ]; then
  287.  
  288.    GNUSTEP_PATHLIST=`$GNUSTEP_MAKEFILES/print_unique_pathlist.sh "$GNUSTEP_USER_ROOT" "$GNUSTEP_LOCAL_ROOT" "$GNUSTEP_NETWORK_ROOT" "$GNUSTEP_SYSTEM_ROOT" $fixup_paths`
  289.    export GNUSTEP_PATHLIST
  290.   fi
  291. fi
  292.  
  293. #
  294. # Add path to Tools to PATH
  295. #
  296. # NB: functionally, print_unique_pathlist.sh is mostly used to do the
  297. # fixup_paths thing, since duplicated paths will automatically be
  298. # checked below when we add them to the PATH.  On the other hand,
  299. # removing duplicates later can be expensive since we do a echo+grep
  300. # for each duplicate.  When there are many duplicates it's faster to
  301. # use print_unique_pathlist.sh first to remove them and skip the
  302. # echos+greps later.
  303. GNUSTEP_TOOLS_PATHLIST=`$GNUSTEP_MAKEFILES/print_unique_pathlist.sh "$GNUSTEP_USER_TOOLS" "$GNUSTEP_LOCAL_TOOLS" "$GNUSTEP_NETWORK_TOOLS" "$GNUSTEP_SYSTEM_TOOLS" $fixup_paths`
  304.  
  305. # Now, we check the paths in GNUSTEP_*_ADMIN_TOOLS.  These paths
  306. # should only be used by Administrators -- normal users don't have
  307. # enough powers to use those tools to do useful things.  Our test for
  308. # being an 'Administrator' is that anyone who can write to an Admin
  309. # directory can be considered powerful enough to use those tools.
  310.  
  311. # FIXME: Unfortunately, this doesn't work if the Admin directory
  312. # is mounted read-only, so a better test is required!
  313.  
  314. # So we examine GNUSTEP_*_ADMIN_TOOLS; if we find any path in that
  315. # list that exists and that we can write to, we add it to our PATH.
  316. for dir in "$GNUSTEP_SYSTEM_ADMIN_TOOLS" "$GNUSTEP_NETWORK_ADMIN_TOOLS" "$GNUSTEP_LOCAL_ADMIN_TOOLS" "$GNUSTEP_USER_ADMIN_TOOLS"; do
  317.   if [ -d "$dir"  -a  -w "$dir" ]; then
  318.     # Only add the new dir if it's not already in GNUSTEP_TOOLS_PATHLIST
  319.     if (echo ":${GNUSTEP_TOOLS_PATHLIST}:" \
  320.       |grep -v ":${dir}:" >/dev/null); then
  321.       GNUSTEP_TOOLS_PATHLIST="$dir:$GNUSTEP_TOOLS_PATHLIST"
  322.     fi
  323.   fi
  324. done
  325.  
  326. #
  327. # And now, we put the results into PATH
  328. #
  329. old_IFS="$IFS"
  330. IFS=:
  331. for dir in $GNUSTEP_TOOLS_PATHLIST; do
  332.  
  333.   # Prepare the path_fragment
  334.   if [ "$GNUSTEP_IS_FLATTENED" = "no" ]; then
  335.     path_fragment="$dir:$dir/${GNUSTEP_HOST_CPU}/${GNUSTEP_HOST_OS}/${LIBRARY_COMBO}:$dir/${GNUSTEP_HOST_CPU}/${GNUSTEP_HOST_OS}"
  336.   else
  337.     path_fragment="$dir"
  338.   fi
  339.  
  340.   # Add it to PATH, but only if not already there (eg, typically /usr/bin is already there)
  341.   if [ -z "$PATH" ]; then
  342.     PATH="$path_fragment"
  343.   else
  344.     if ( echo ":${PATH}:"\
  345.       |grep -v ":${path_fragment}:" >/dev/null ); then
  346.       PATH="${path_fragment}:${PATH}"
  347.     fi
  348.   fi
  349.  
  350. done
  351. IFS="$old_IFS"
  352. unset old_IFS
  353. unset dir
  354. unset path_fragment
  355. unset GNUSTEP_TOOLS_PATHLIST
  356. export PATH
  357.  
  358. # Determine the library paths
  359. GNUSTEP_LIBRARIES_PATHLIST=`$GNUSTEP_MAKEFILES/print_unique_pathlist.sh "$GNUSTEP_USER_LIBRARIES" "$GNUSTEP_LOCAL_LIBRARIES" "$GNUSTEP_NETWORK_LIBRARIES" "$GNUSTEP_SYSTEM_LIBRARIES" $fixup_paths`
  360.  
  361. old_IFS="$IFS"
  362. IFS=:
  363.   for dir in $GNUSTEP_LIBRARIES_PATHLIST; do
  364.  
  365.     # prepare the path_fragment for libraries and this dir
  366.     if [ "$GNUSTEP_IS_FLATTENED" = "yes" ]; then
  367.       path_fragment="$dir"
  368.     else
  369.       path_fragment="$dir/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO:$dir/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS"
  370.     fi
  371.  
  372.     # Append the path_fragment to lib_paths ... in a different way,
  373.     # depending on the machine we're on.
  374.     case "$GNUSTEP_HOST_OS" in
  375.  
  376.       *nextstep4* | *darwin*)
  377.         if [ -z "$DYLD_LIBRARY_PATH" ]; then
  378.           DYLD_LIBRARY_PATH="$path_fragment"
  379.         else
  380.           if ( echo ":${DYLD_LIBRARY_PATH}:"\
  381.         |grep -v ":${path_fragment}:" >/dev/null ); then
  382.         DYLD_LIBRARY_PATH="$path_fragment:$DYLD_LIBRARY_PATH"
  383.           fi
  384.         fi
  385.         export DYLD_LIBRARY_PATH;;
  386.  
  387.       *hpux*)
  388.         if [ -z "$SHLIB_PATH" ]; then
  389.           SHLIB_PATH="$path_fragment"
  390.         else
  391.           if ( echo ":${SHLIB_PATH}:"\
  392.         |grep -v ":${path_fragment}:" >/dev/null ); then
  393.         SHLIB_PATH="$path_fragment:$SHLIB_PATH"
  394.           fi
  395.         fi
  396.         export SHLIB_PATH;
  397.  
  398.         if [ -z "$LD_LIBRARY_PATH" ]; then
  399.           LD_LIBRARY_PATH="$path_fragment"
  400.         else
  401.           if ( echo ":${LD_LIBRARY_PATH}:"\
  402.         |grep -v ":${path_fragment}:" >/dev/null ); then
  403.         LD_LIBRARY_PATH="$path_fragment:$LD_LIBRARY_PATH"
  404.           fi
  405.         fi
  406.         export LD_LIBRARY_PATH;;
  407.  
  408.       *)
  409.         if [ -z "$LD_LIBRARY_PATH" ]; then
  410.           LD_LIBRARY_PATH="$path_fragment"
  411.         else
  412.           if ( echo ":${LD_LIBRARY_PATH}:"\
  413.         |grep -v ":${path_fragment}:" >/dev/null ); then
  414.         LD_LIBRARY_PATH="$path_fragment:$LD_LIBRARY_PATH"
  415.           fi
  416.         fi
  417.         export LD_LIBRARY_PATH;;
  418.     esac
  419.   done
  420. IFS="$old_IFS"
  421. unset old_IFS
  422. unset dir
  423. unset path_fragment
  424.  
  425. unset GNUSTEP_LIBRARIES_PATHLIST
  426.  
  427.  
  428. # Determine the framework paths - but only on Darwin since it's the
  429. # only platform where this is of any use.
  430. case "$GNUSTEP_HOST_OS" in
  431.  
  432.   *darwin*)
  433.     GNUSTEP_FRAMEWORKS_PATHLIST=`$GNUSTEP_MAKEFILES/print_unique_pathlist.sh "$GNUSTEP_USER_LIBRARY/Frameworks" "$GNUSTEP_LOCAL_LIBRARY/Frameworks" "$GNUSTEP_NETWORK_LIBRARY/Frameworks" "$GNUSTEP_SYSTEM_LIBRARY/Frameworks" $fixup_paths`
  434.  
  435.     old_IFS="$IFS"
  436.     IFS=:
  437.     for dir in $GNUSTEP_FRAMEWORKS_PATHLIST; do
  438.  
  439.       # prepare the path_fragment for frameworks
  440.       path_fragment="$dir"
  441.  
  442. # The code below has been temporarily removed, because...
  443. # Frameworks in GNUstep-make are supported by creating a link like
  444. #   Libraries/libMyFramework.dylib ->
  445. #      Frameworks/MyFramework.framework/Versions/Current/libMyFramework.dylib,
  446. #
  447. # to mitigate the fact that FSF GCC does not support a -framework flag.
  448. #
  449. # On Darwin, however, we partially emulate -framework by setting the
  450. # "install_name" to the framework name during linking. The dynamic
  451. # linker (dyld) is smart enough to find the framework under this name,
  452. # but only if DYLD_FRAMEWORK_PATH is set (unless we set the
  453. # "install_name" to an absolute path, which we don't). We'd really like
  454. # to fully support -framework, though.
  455. #
  456. # Use otool -L MyApplication.app/MyApplication, for instance, to see
  457. # how the shared libraries/frameworks are linked.
  458. #
  459. #    if [ "$LIBRARY_COMBO" = "apple-apple-apple" -o \
  460. #         "$LIBRARY_COMBO" = "apple" ]; then
  461.     
  462.       if [ -z "$DYLD_FRAMEWORK_PATH" ]; then
  463.         DYLD_FRAMEWORK_PATH="$path_fragment"
  464.       else
  465.         if ( echo ":${DYLD_FRAMEWORK_PATH}:"\
  466.       |grep -v ":${path_fragment}:" >/dev/null ); then
  467.           DYLD_FRAMEWORK_PATH="$path_fragment:$DYLD_FRAMEWORK_PATH"
  468.         fi
  469.       fi
  470.       export DYLD_FRAMEWORK_PATH
  471.     done
  472.  
  473.     IFS="$old_IFS"
  474.     unset old_IFS
  475.     unset dir
  476.     unset path_fragment
  477.  
  478.     unset GNUSTEP_FRAMEWORKS_PATHLIST
  479.     ;;
  480.  
  481.   *)
  482.     ;;
  483. esac
  484.  
  485. #
  486. # Setup Java CLASSPATH and Guile GUILE_LOAD_PATH
  487. #
  488. GNUSTEP_LIBRARY_PATHLIST=`$GNUSTEP_MAKEFILES/print_unique_pathlist.sh "$GNUSTEP_USER_LIBRARY" "$GNUSTEP_LOCAL_LIBRARY" "$GNUSTEP_NETWORK_LIBRARY" "$GNUSTEP_SYSTEM_LIBRARY" $fixup_paths`
  489.  
  490. old_IFS="$IFS"
  491. IFS=:
  492. for dir in $GNUSTEP_LIBRARY_PATHLIST; do
  493.  
  494.   path_fragment="$dir/Libraries/Java"
  495.   if [ -z "$CLASSPATH" ]; then
  496.     CLASSPATH="$path_fragment"
  497.   else
  498.     if ( echo ":${CLASSPATH}:"\
  499.       |grep -v ":${path_fragment}:" >/dev/null ); then
  500.       CLASSPATH="$CLASSPATH:$path_fragment"
  501.     fi
  502.   fi
  503.  
  504.   path_fragment="$dir/Libraries/Guile"
  505.   if [ -z "$GUILE_LOAD_PATH" ]; then
  506.     GUILE_LOAD_PATH="$path_fragment"
  507.   else
  508.     if ( echo ":${GUILE_LOAD_PATH}:"\
  509.       |grep -v ":${path_fragment}:" >/dev/null ); then
  510.       GUILE_LOAD_PATH="$path_fragment:$GUILE_LOAD_PATH"
  511.     fi
  512.   fi
  513.  
  514. done
  515. IFS="$old_IFS"
  516. unset old_IFS
  517. unset dir
  518. unset path_fragment
  519. export CLASSPATH
  520. export GUILE_LOAD_PATH
  521.  
  522. #
  523. # Make sure info files, that we install by default into
  524. # xxx/Library/Documentation/info, are found by the info browsing
  525. # programs.  To get this effect, we add those paths to INFOPATH.
  526. #
  527. GNUSTEP_INFO_PATHLIST=`$GNUSTEP_MAKEFILES/print_unique_pathlist.sh "$GNUSTEP_USER_DOC_INFO" "$GNUSTEP_LOCAL_DOC_INFO" "$GNUSTEP_NETWORK_DOC_INFO" "$GNUSTEP_SYSTEM_DOC_INFO" $fixup_paths`
  528. old_IFS="$IFS"
  529. IFS=:
  530. for dir in $GNUSTEP_INFO_PATHLIST; do
  531.  
  532.   if [ -z "$INFOPATH" ]; then
  533.     # The ':' at the end means to use the built-in paths after searching
  534.     # the INFOPATH we provide.
  535.     INFOPATH="${dir}:"
  536.   else
  537.     if ( echo ":${INFOPATH}:"\
  538.       |grep -v ":${dir}:" >/dev/null ); then
  539.       INFOPATH="$INFOPATH:${dir}:"
  540.     fi
  541.   fi
  542. done
  543. IFS="$old_IFS"
  544. unset old_IFS
  545. unset dir
  546. unset GNUSTEP_INFO_PATHLIST
  547. export INFOPATH
  548.  
  549. #
  550. # Clean up the environment by removing the filesystem variables.  Do
  551. # it unless we were explicitly requested not to clean it up!  Mostly
  552. # gnustep-config will request that the environment is not cleaned up,
  553. # so it can print out all of the GNUstep variables.
  554. #
  555. if [ -n "$GNUSTEP_SH_EXPORT_ALL_VARIABLES" ]; then
  556.   export GNUSTEP_MAKE_STRICT_V2_MODE
  557.  
  558.   unset GNUSTEP_KEEP_CONFIG_FILE GNUSTEP_KEEP_USER_CONFIG_FILE
  559.  
  560.   export GNUSTEP_CONFIG_FILE GNUSTEP_USER_CONFIG_FILE
  561.  
  562.   export GNUSTEP_USER_DEFAULTS_DIR
  563.  
  564.   # Always export these variables even if in strict gnustep-make v2
  565.   # mode, so that for example gnustep-config can determine them.
  566.   export GNUSTEP_IS_FLATTENED LIBRARY_COMBO
  567.   export GNUSTEP_HOST GNUSTEP_HOST_CPU GNUSTEP_HOST_VENDOR GNUSTEP_HOST_OS
  568.  
  569.   export GNUSTEP_SYSTEM_APPS GNUSTEP_SYSTEM_ADMIN_APPS GNUSTEP_SYSTEM_WEB_APPS GNUSTEP_SYSTEM_TOOLS GNUSTEP_SYSTEM_ADMIN_TOOLS 
  570.   export GNUSTEP_SYSTEM_LIBRARY GNUSTEP_SYSTEM_HEADERS GNUSTEP_SYSTEM_LIBRARIES
  571.   export GNUSTEP_SYSTEM_DOC GNUSTEP_SYSTEM_DOC_MAN GNUSTEP_SYSTEM_DOC_INFO
  572.  
  573.   export GNUSTEP_NETWORK_APPS GNUSTEP_NETWORK_ADMIN_APPS GNUSTEP_NETWORK_WEB_APPS GNUSTEP_NETWORK_TOOLS GNUSTEP_NETWORK_ADMIN_TOOLS 
  574.   export GNUSTEP_NETWORK_LIBRARY GNUSTEP_NETWORK_HEADERS GNUSTEP_NETWORK_LIBRARIES
  575.   export GNUSTEP_NETWORK_DOC GNUSTEP_NETWORK_DOC_MAN GNUSTEP_NETWORK_DOC_INFO
  576.  
  577.   export GNUSTEP_LOCAL_APPS GNUSTEP_LOCAL_ADMIN_APPS GNUSTEP_LOCAL_WEB_APPS GNUSTEP_LOCAL_TOOLS GNUSTEP_LOCAL_ADMIN_TOOLS 
  578.   export GNUSTEP_LOCAL_LIBRARY GNUSTEP_LOCAL_HEADERS GNUSTEP_LOCAL_LIBRARIES
  579.   export GNUSTEP_LOCAL_DOC GNUSTEP_LOCAL_DOC_MAN GNUSTEP_LOCAL_DOC_INFO
  580.  
  581.   export GNUSTEP_USER_APPS GNUSTEP_USER_ADMIN_APPS GNUSTEP_USER_WEB_APPS GNUSTEP_USER_TOOLS GNUSTEP_USER_ADMIN_TOOLS 
  582.   export GNUSTEP_USER_LIBRARY GNUSTEP_USER_HEADERS GNUSTEP_USER_LIBRARIES
  583.   export GNUSTEP_USER_DOC GNUSTEP_USER_DOC_MAN GNUSTEP_USER_DOC_INFO
  584.  
  585.   export GNUSTEP_SYSTEM_USERS_DIR GNUSTEP_LOCAL_USERS_DIR GNUSTEP_NETWORK_USERS_DIR
  586. else
  587.   if [ "$GNUSTEP_MAKE_STRICT_V2_MODE" = "yes" ]; then
  588.     unset GNUSTEP_IS_FLATTENED
  589.     unset LIBRARY_COMBO
  590.     unset GNUSTEP_HOST
  591.     unset GNUSTEP_HOST_CPU
  592.     unset GNUSTEP_HOST_VENDOR
  593.     unset GNUSTEP_HOST_OS
  594.   fi
  595.  
  596.   unset GNUSTEP_MAKE_STRICT_V2_MODE
  597.  
  598.   # Unset these variables but only if we set them internally; keep
  599.   # them if they were already in the environment.
  600.   if [ -z "$GNUSTEP_KEEP_CONFIG_FILE" ]; then
  601.     unset GNUSTEP_CONFIG_FILE
  602.   fi
  603.   unset GNUSTEP_KEEP_CONFIG_FILE 
  604.  
  605.   if [ -z "$GNUSTEP_KEEP_USER_CONFIG_FILE" ]; then
  606.     unset GNUSTEP_USER_CONFIG_FILE
  607.   fi
  608.   unset GNUSTEP_KEEP_USER_CONFIG_FILE
  609.  
  610.   # Always unset these variables
  611.   unset GNUSTEP_USER_DEFAULTS_DIR
  612.  
  613.   unset GNUSTEP_SYSTEM_APPS 
  614.   unset GNUSTEP_SYSTEM_ADMIN_APPS 
  615.   unset GNUSTEP_SYSTEM_WEB_APPS 
  616.   unset GNUSTEP_SYSTEM_TOOLS 
  617.   unset GNUSTEP_SYSTEM_ADMIN_TOOLS 
  618.   unset GNUSTEP_SYSTEM_LIBRARY
  619.   unset GNUSTEP_SYSTEM_HEADERS 
  620.   unset GNUSTEP_SYSTEM_LIBRARIES 
  621.   unset GNUSTEP_SYSTEM_DOC 
  622.   unset GNUSTEP_SYSTEM_DOC_MAN
  623.   unset GNUSTEP_SYSTEM_DOC_INFO
  624.  
  625.   unset GNUSTEP_NETWORK_APPS 
  626.   unset GNUSTEP_NETWORK_ADMIN_APPS 
  627.   unset GNUSTEP_NETWORK_WEB_APPS 
  628.   unset GNUSTEP_NETWORK_TOOLS 
  629.   unset GNUSTEP_NETWORK_ADMIN_TOOLS 
  630.   unset GNUSTEP_NETWORK_LIBRARY
  631.   unset GNUSTEP_NETWORK_HEADERS 
  632.   unset GNUSTEP_NETWORK_LIBRARIES 
  633.   unset GNUSTEP_NETWORK_DOC 
  634.   unset GNUSTEP_NETWORK_DOC_MAN
  635.   unset GNUSTEP_NETWORK_DOC_INFO
  636.  
  637.   unset GNUSTEP_LOCAL_APPS 
  638.   unset GNUSTEP_LOCAL_ADMIN_APPS 
  639.   unset GNUSTEP_LOCAL_WEB_APPS 
  640.   unset GNUSTEP_LOCAL_TOOLS 
  641.   unset GNUSTEP_LOCAL_ADMIN_TOOLS 
  642.   unset GNUSTEP_LOCAL_LIBRARY
  643.   unset GNUSTEP_LOCAL_HEADERS 
  644.   unset GNUSTEP_LOCAL_LIBRARIES 
  645.   unset GNUSTEP_LOCAL_DOC 
  646.   unset GNUSTEP_LOCAL_DOC_MAN
  647.   unset GNUSTEP_LOCAL_DOC_INFO
  648.  
  649.   unset GNUSTEP_USER_APPS 
  650.   unset GNUSTEP_USER_ADMIN_APPS 
  651.   unset GNUSTEP_USER_WEB_APPS 
  652.   unset GNUSTEP_USER_TOOLS 
  653.   unset GNUSTEP_USER_ADMIN_TOOLS 
  654.   unset GNUSTEP_USER_LIBRARY
  655.   unset GNUSTEP_USER_HEADERS 
  656.   unset GNUSTEP_USER_LIBRARIES 
  657.   unset GNUSTEP_USER_DOC 
  658.   unset GNUSTEP_USER_DOC_MAN
  659.   unset GNUSTEP_USER_DOC_INFO
  660.  
  661.   unset GNUSTEP_SYSTEM_USERS_DIR
  662.   unset GNUSTEP_LOCAL_USERS_DIR
  663.   unset GNUSTEP_NETWORK_USERS_DIR
  664. fi
  665.  
  666. if [ -n "$GS_ZSH_NEED_TO_RESTORE_SET" ]; then
  667.   set +y
  668. fi
  669. # EOF
  670.